/// <reference path="../../sage/sage.util.js" />

var MistPainter = Base.extend({
    initialize: function initialize() { },
    paint: function paint(context) {
        var viewWidth = context.viewPort.size.w,
            viewHeight = context.viewPort.size.h,
            mistHeight = Math.round(context.viewPort.size.h * context.gameObject.percentage);

        var min = mistHeight / 5;
        if (min < 4) min = 4;
        context.frontLayer.fillStyle = context.gameObject.color;
        for (var i = min; i < mistHeight; i += (min / 2)) {
            context.frontLayer.fillRect(0, ((viewHeight - i) / 2), viewWidth, i);
        }
    }
});
